
from selenium.webdriver.common.by import By

from page.base import Base


class Login(Base):

	def login(self, username, password, code):
		self.find_wait(By.CSS_SELECTOR, '#username').send_keys(username)
		self.find(By.CSS_SELECTOR, '#password').send_keys(password)
		self.find(By.CSS_SELECTOR, '.getCode').click()
		self.find(By.CSS_SELECTOR, '#code').send_keys(code)
		self.find((By.CSS_SELECTOR, '[type=submit]')).click()

